package com.wdg.controller;

import com.wdg.fegin.IUserCenterFegin;
import com.wdg.pojo.Cookbook;
import com.wdg.pojo.Topic;
import com.wdg.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("UserCenter")
public class UserCenterController {

    @Autowired
    private IUserCenterFegin userCenterFegin;

    @GetMapping("/getCookBookByUid")
    public List<Cookbook> getCookBookByUid(@RequestParam("uid") int uid){

        System.out.println(uid);
        return userCenterFegin.getCookBookByUid(uid);
    }

    @GetMapping("/getTopicByUid")
    public List<Topic> getTopicByUid(@RequestParam("uid") int uid){

        System.out.println(uid);
        return userCenterFegin.getTopicByUid(uid);
    }

    //获得我的关注
    @GetMapping("/getMyFocus")
    public List<User> getMyFocus(@RequestParam String uid){
        return userCenterFegin.getMyFocus(uid);
    }
    //获得我的收藏
    @GetMapping("/getMyStatoff")
    public List<Cookbook> getMyStatoff(@RequestParam String uid){
        return userCenterFegin.getMyStatoff(uid);
    }



}
